package org.bravof.common;

import com.google.common.base.CaseFormat;
import org.springframework.stereotype.Component;

/**
 * 字符串风格处理工具
 */
@Component
public class CaseUtils {
    /**
     * snake 风格字符串转 camel , 首字母小写
     * @param string
     * @return
     */
    public String snakeToLowerCamel(String string) {
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, string);
    }

    /**
     * snake 风格字符串转 camel , 首字母大写
     * @param string
     * @return
     */
    public String snakeToUpperCame(String string) {
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, string);
    }
}
